#include <iostream>

/*int main() {
    long long int a, b, n, r, r1, r2, r3, i;
    scanf("%lld%lld%lld", &a, &b, &n);
    r = a % b;
    for (i = 1; i <= n - 1; i++) {
        r = r * 10 % b;
    }
    r1 = r * 10 / b;
    r2 = r * 10 % b * 10 / b;
    r3 = r * 10 % b * 10 % b * 10 / b;
    printf("%lld%lld%lld", r1, r2, r3);
    return 0;
}*/
int main() {
    long long int a, b, n, r, r1, r2, r3, i, c;
    scanf("%lld%lld%lld", &a, &b, &n);
    r = a % b;
    c = (1000000000 % b) * (1000000000 % b);
    for (i = 18; i <= n - 1; i = i + 18)
        r = r * c % b;
    if (i - (n - 1) != 18)
        for (i = i - 18 + 1; i <= n - 1; i++)
            r = r * 10 % b;
    r1 = r * 10 / b;
    r2 = r * 10 % b * 10 / b;
    r3 = r * 10 % b * 10 % b * 10 / b;
    printf("%lld%lld%lld", r1, r2, r3);
    return 0;
}

